from socketio import Server
from socketio import RedisManager
from apps.websocket.namespace.BaseNamespace import BaseNamespace
from django.conf import settings

from django.apps import AppConfig


class CommonConfig(AppConfig):
    name = 'websocket'



manager = RedisManager('redis://127.0.0.1:6379/3')
sio = Server(async_mode='gevent_uwsgi', cors_allowed_origins=['http://localhost','http://localhost:8080','http://106.54.240.219'], client_manager=manager)
# sio = Server(async_mode='threading', cors_allowed_origins=['http://localhost','http://localhost:8080','http://106.54.240.219'], client_manager=manager)
sio.register_namespace(BaseNamespace('/'))
